<html>
<head><meta charset="utf-8"><title>benchmarking procedural macros · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html">benchmarking procedural macros</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="172676702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172676702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172676702">(Aug 07 2019 at 13:18)</a>:</h4>
<p>Over in SNAFU, we were blindly micro-optimizing our procedural macro for fun (I think this is the Rust curse). If we really wanted to optimize, I'd want to have some kind of performance test, but I couldn't think how I might do such a thing. Is it possible somehow?</p>



<a name="172678697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172678697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172678697">(Aug 07 2019 at 13:41)</a>:</h4>
<p>We don't really provide an easy way to do it, but presumably you could run the compiler in total (cargo check or such) and measure differences in that. It's not great since there will be very high variance but ... well, it's a start</p>



<a name="172678769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172678769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172678769">(Aug 07 2019 at 13:42)</a>:</h4>
<p>Maybe can get away with something like -Zexpand-only (I forget the flag) which'll hopefully reduce some of the variance</p>



<a name="172679447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172679447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172679447">(Aug 07 2019 at 13:50)</a>:</h4>
<p>I guess at some level, it's "just" calling <code>fn my_derive(input: TokenStream) -&gt; TokenStream</code>, so I "just" need to build a <code>TokenStream</code>.</p>



<a name="172680474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172680474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172680474">(Aug 07 2019 at 14:02)</a>:</h4>
<p>Right, which is technically possible (rustc has no direct knowledge, in theory, and the interface is ABI stable I think)</p>



<a name="172680513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172680513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172680513">(Aug 07 2019 at 14:03)</a>:</h4>
<p>C ABI IIRC</p>



<a name="172682687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172682687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172682687">(Aug 07 2019 at 14:30)</a>:</h4>
<p>I mean it more basic than that:</p>
<div class="codehilite"><pre><span></span><span class="k">extern</span><span class="w"> </span><span class="k">crate</span><span class="w"> </span><span class="n">proc_macro</span><span class="p">;</span><span class="w"></span>

<span class="k">use</span><span class="w"> </span><span class="n">proc_macro</span>::<span class="n">TokenStream</span><span class="p">;</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">snafu_derive</span><span class="p">(</span><span class="n">input</span>: <span class="nc">TokenStream</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TokenStream</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">unimplemented</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;My macro goes here&quot;</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">input</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">r#&quot;struct Foo;&quot;#</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">snafu_derive</span><span class="p">(</span><span class="n">input</span><span class="p">.</span><span class="n">parse</span><span class="p">().</span><span class="n">unwrap</span><span class="p">());</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="172682719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172682719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172682719">(Aug 07 2019 at 14:30)</a>:</h4>
<p>Unfortunately:</p>
<div class="codehilite"><pre><span></span>thread &#39;main&#39; panicked at &#39;procedural macro API is used outside of a procedural macro&#39;, src/libproc_macro/bridge/client.rs:315:17
</pre></div>



<a name="172682781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172682781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172682781">(Aug 07 2019 at 14:31)</a>:</h4>
<p>Right, yeah, you can't create tokenstreams outside of a given proc macro invocation (or indeed pass across proc macro boundaries)</p>



<a name="172682801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172682801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172682801">(Aug 07 2019 at 14:31)</a>:</h4>
<p>You could presumably expand recursively and time the innards of the proc_macro function, storing that off into some global though</p>



<a name="172682899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172682899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172682899">(Aug 07 2019 at 14:32)</a>:</h4>
<blockquote>
<p>you can't create tokenstreams outside of a given proc macro invocation</p>
</blockquote>
<p>Is there a fundamental reason for this, or is it just "we haven't thought through this yet"?</p>



<a name="172683116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683116">(Aug 07 2019 at 14:35)</a>:</h4>
<p>Well, it's tied to compiler internals</p>



<a name="172683126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683126">(Aug 07 2019 at 14:35)</a>:</h4>
<p>And we want to expand in arbitrary order and such</p>



<a name="172683141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683141">(Aug 07 2019 at 14:35)</a>:</h4>
<p>we basically want the compiler to be in control and not a proc macro crate starting to call the compiler (unexpectedly for the compiler)</p>



<a name="172683190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683190">(Aug 07 2019 at 14:36)</a>:</h4>
<p>proc macro crates also don't _link_ to the compiler AFAIK, they just know about the C structs that are passed into them</p>



<a name="172683243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683243">(Aug 07 2019 at 14:37)</a>:</h4>
<p>so they can't actually make a tokenstream if that makes sense (only the compiler knows how)</p>



<a name="172683375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683375">(Aug 07 2019 at 14:38)</a>:</h4>
<p>I guess I could swap to a <code>proc_macro2::TokenStream</code> immediately, and test against that:</p>
<div class="codehilite"><pre><span></span><span class="k">extern</span><span class="w"> </span><span class="k">crate</span><span class="w"> </span><span class="n">proc_macro</span><span class="p">;</span><span class="w"></span>

<span class="k">use</span><span class="w"> </span><span class="n">proc_macro</span>::<span class="n">TokenStream</span><span class="p">;</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">snafu_derive</span><span class="p">(</span><span class="n">input</span>: <span class="nc">TokenStream</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TokenStream</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span><span class="p">.</span><span class="n">into</span><span class="p">()).</span><span class="n">into</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span>: <span class="nc">proc_macro2</span>::<span class="n">TokenStream</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">proc_macro2</span>::<span class="n">TokenStream</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">unimplemented</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;My macro goes here&quot;</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">input</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">r#&quot;struct Foo;&quot;#</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span><span class="p">.</span><span class="n">parse</span><span class="p">().</span><span class="n">unwrap</span><span class="p">());</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="172683481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683481">(Aug 07 2019 at 14:40)</a>:</h4>
<p>Which might have its own bit of overhead in the conversion, but I think I'm already doing this anyway...</p>



<a name="172683903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683903">(Aug 07 2019 at 14:45)</a>:</h4>
<p>well, the main function won't work</p>



<a name="172683923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683923">(Aug 07 2019 at 14:46)</a>:</h4>
<p>you _cannot_ create a tokenstream without the compiler (or another implementor of proc_macro bridge, of which none exist)</p>



<a name="172683985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172683985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172683985">(Aug 07 2019 at 14:46)</a>:</h4>
<p>proc_macro2::Tokenstream is just a (somewhat thin) wrapper around proc_macro::Tokenstream</p>



<a name="172684253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684253">(Aug 07 2019 at 14:49)</a>:</h4>
<blockquote>
<p>well, the main function won't work</p>
</blockquote>
<p>Can you expand on that? </p>
<div class="codehilite"><pre><span></span><span class="k">extern</span><span class="w"> </span><span class="k">crate</span><span class="w"> </span><span class="n">proc_macro</span><span class="p">;</span><span class="w"></span>

<span class="k">use</span><span class="w"> </span><span class="n">proc_macro</span>::<span class="n">TokenStream</span><span class="p">;</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">snafu_derive</span><span class="p">(</span><span class="n">input</span>: <span class="nc">TokenStream</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TokenStream</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span><span class="p">.</span><span class="n">into</span><span class="p">()).</span><span class="n">into</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span>: <span class="nc">proc_macro2</span>::<span class="n">TokenStream</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">proc_macro2</span>::<span class="n">TokenStream</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">s</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">syn</span>::<span class="n">parse2</span>::<span class="o">&lt;</span><span class="n">syn</span>::<span class="n">ItemStruct</span><span class="o">&gt;</span><span class="p">(</span><span class="n">input</span><span class="p">).</span><span class="n">expect</span><span class="p">(</span><span class="s">&quot;Failed to parse&quot;</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="n">eprintln</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;Parsed it: {:?}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">s</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="nb">Default</span>::<span class="n">default</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">input</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">r#&quot;struct Foo;&quot;#</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">snafu_derive_inner</span><span class="p">(</span><span class="n">input</span><span class="p">.</span><span class="n">parse</span><span class="p">().</span><span class="n">unwrap</span><span class="p">());</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<div class="codehilite"><pre><span></span>Parsed it: ItemStruct { attrs: [], vis: Inherited, struct_token: Struct, ident: Ident(Foo), generics: Generics { lt_token: None, params: [], gt_token: None, where_clause: None }, fields: Unit, semi_token: Some(Semi) }
</pre></div>


<p><a href="https://play.integer32.com/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=9f21c79dbd4d6779ba03dc4fcc1b9122" target="_blank" title="https://play.integer32.com/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=9f21c79dbd4d6779ba03dc4fcc1b9122">Playground</a></p>



<a name="172684343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684343">(Aug 07 2019 at 14:50)</a>:</h4>
<p>Hm, that's surprising to me</p>



<a name="172684354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684354">(Aug 07 2019 at 14:50)</a>:</h4>
<p>I would expect that to return the 'could not parse' error</p>



<a name="172684372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684372">(Aug 07 2019 at 14:50)</a>:</h4>
<p>er, could not create w/o proc macro expansion</p>



<a name="172684399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684399">(Aug 07 2019 at 14:51)</a>:</h4>
<p>Maybe I misunderstood how proc_macro2 works though</p>



<a name="172684405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684405">(Aug 07 2019 at 14:51)</a>:</h4>
<p>I don't believe it's a thin wrapper. I think it basically reparses everything</p>



<a name="172684429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684429">(Aug 07 2019 at 14:51)</a>:</h4>
<p>Oh interesting</p>



<a name="172684441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684441">(Aug 07 2019 at 14:51)</a>:</h4>
<p>I did not know that was the case</p>



<a name="172684507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684507">(Aug 07 2019 at 14:52)</a>:</h4>
<p>I haven't looked at the code, so I'm just guessing, mostly.</p>



<a name="172684530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684530">(Aug 07 2019 at 14:52)</a>:</h4>
<p>Yeah, that's what it looks like based on the API docs</p>



<a name="172684536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/benchmarking%20procedural%20macros/near/172684536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/benchmarking.20procedural.20macros.html#172684536">(Aug 07 2019 at 14:52)</a>:</h4>
<p>It makes sense, I guess</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>